#!/usr/bin/env python
# -*- encoding: utf-8 -*-
# Project: spd-sxmcc
"""
@author: lyndon
@time Created on 2018/9/20 13:07
@desc
"""
import datetime
import time
import os
#
# def func(p1, p2):
#     print("params1:" + str(p1 + "," + p2))
#
#
# def func(p1):
#     print("params2:" + str(p1))
#
#
# # print(func("a","b"))
#
#
# a = 1
# b = "b" + ("4" if a == 0 else "x")
#
# print(b)
#
# ss = 'desc %s.%s' % ('ptemp3', 'table')
# print(ss)
#
# dd = datetime.date
# print(dd)
#
# dt = time.strftime('%Y-%m-%d', time.localtime())
# print(dt)
# print(type(dt))
#
# a1 = 100
# a2 = 32
# a3 = a1.__sub__(a2)
# print(a3)
#
#
# aaaa = [u'\u5efa\u7b51\u5e74\u4ee3\uff1a2002\u5e74', u'\u5efa\u7b51\u7c7b\u578b\uff1a\u677f\u5854\u7ed3\u5408', u'\u697c\u680b\u603b\u6570\uff1a15', u'\u623f\u5c4b\u603b\u6570\uff1a879\u6237', u'\u4e8c\u624b\u623f\u6e90\uff1a41\u5957', u'\u79df\u623f\u623f\u6e90\uff1a22\u5957']
#
# for each_a in aaaa:
#     print(each_a.encode('utf-8'))
# print('===---- bbbb ====')
# bbbb = ['\xe5\xbb\xba\xe7\xad\x91\xe5\xb9\xb4\xe4\xbb\xa3\xef\xbc\x9a1997\xe5\xb9\xb4', '\xe5\xbb\xba\xe7\xad\x91\xe7\xb1\xbb\xe5\x9e\x8b\xef\xbc\x9a\xe6\x9d\xbf\xe5\xa1\x94\xe7\xbb\x93\xe5\x90\x88', '\xe6\xa5\xbc\xe6\xa0\x8b\xe6\x80\xbb\xe6\x95\xb0\xef\xbc\x9a57', '\xe6\x88\xbf\xe5\xb1\x8b\xe6\x80\xbb\xe6\x95\xb0\xef\xbc\x9a3638\xe6\x88\xb7', '\xe4\xba\x8c\xe6\x89\x8b\xe6\x88\xbf\xe6\xba\x90\xef\xbc\x9a30\xe5\xa5\x97', '\xe7\xa7\x9f\xe6\x88\xbf\xe6\x88\xbf\xe6\xba\x90\xef\xbc\x9a40\xe5\xa5\x97']
#
# for each_b in bbbb:
#     print(each_b)
#


imgPathCfg = r"D:\iProject\myPython\com\teradata\analyzer\data" + os.sep + '13934578599' + '.png'

print(imgPathCfg)

print(imgPathCfg.split(os.sep)[-1].split('.')[1])


a = 'aa'
aa = '1' if a else '0'
print(aa)


print(os.sep)



def gen_pid_file(pid):
    with open('fork.PID', 'w') as f:
        f.write(pid)

gen_pid_file('123')

def read_pid_file(file):
    with open(file, 'r') as f:
        pid = f.read()
    return pid

try:
    pid = read_pid_file('fork1.PID')
    print(pid)
except IOError:
    print('not found PID file.')
    pass

processName='main.py'
processPidName = processName.replace('.py','.PID')
print(processName)
print(processPidName)